#pragma once

#include "EquippableItem.h"
#include "ObjectDatabase.h"

class Shield : public EquippableItem {
protected:
	ShieldPrefix m_prefix;
	ShieldSuffix m_suffix;
	MaterialType m_materialType;
	bool m_highQuality;
	int m_block;
	int m_defaultBlock;
	bool isEnchanted() const;
	void calculateStats(const ShieldInfo& info);
public:
	Shield(ShieldType type, MaterialType materialType, ShieldPrefix prefix = SP_NONE, ShieldSuffix suffix = SS_OF_NONE, bool highQuality = false);
	Shield(std::ifstream& file);
	~Shield();
	void render(float x, float y);
	void logDetails(TextLog& log) const;
	ShieldPrefix getPrefix() const;
	ShieldSuffix getSuffix() const;
	int getBlock() const;
	bool isHighQuality() const;
	std::string getItemName(int mod = 0) const;
	void save(std::ofstream& file) const;
};

inline ShieldPrefix Shield::getPrefix() const {return m_prefix;}
inline ShieldSuffix Shield::getSuffix() const {return m_suffix;}
inline int Shield::getBlock() const {return m_block;}
inline bool Shield::isHighQuality() const {return m_highQuality;}
